import { Injectable } from "@nestjs/common";

import {MenuEntity} from './menu.entity'
import { Repository } from "typeorm";
import { InjectRepository } from "@nestjs/typeorm";

@Injectable()
export class MenuService{
    constructor(
        @InjectRepository(MenuEntity)
        private readonly menuService:Repository<MenuEntity>
    ){}
    async find(){
        return await this.menuService.find();
    }
    async findByIds(ids){
        return await this.menuService.findByIds(ids)
    }
    async add(menu){
        return await this.menuService.save(menu);
    }

    async remove(menuId){
        return await this.menuService.delete(menuId);
    }

    async update(menu){
        return await this.menuService.update(menu.menuId,menu);
    }
}